Skip to content

Conversation

@blurrah
Copy link
Owner

@blurrah blurrah commented Sep 8, 2025

Support GQL operations through graphql-config. WIP and AI generated.

Not sure about the precedence yet..

blurrah and others added 5 commits September 8, 2025 15:18
Add comprehensive documentation file to guide Claude Code and other AI assistants
when working with this repository. Includes:
- Essential development commands
- High-level architecture overview
- Core components and design patterns
- Environment variables reference

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Implement dynamic tool generation from GraphQL operation files:
- Auto-discover .graphql/.gql files in configurable directory
- Parse operations and extract variable definitions
- Generate MCP tools with proper Zod schema validation
- Support query/mutation/subscription operations
- Add GRAPHQL_DIR environment variable (defaults to ./graphql)
- Include example GraphQL operation files

Operations are registered as tools with pattern: gql-{operation-name}
Mutations respect ALLOW_MUTATIONS setting for security

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Replace manual file discovery with standard GraphQL Config format:
- Support .graphqlrc.{yml,json} and graphql.config.js files
- Use 'documents' field with glob patterns for operation discovery
- Add multi-project support with namespaced tool names
- Map config fields to existing environment variables for compatibility
- Maintain backward compatibility with GRAPHQL_DIR env var
- Include example config files in multiple formats

Benefits:
- Standard format used by GraphQL ecosystem tools
- Better IDE integration and validation capabilities
- Environment variable interpolation support
- Simplified configuration management

Original introspect-schema and query-graphql tools remain unchanged.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Restructure example files for better organization and package distribution:
- Move all examples to examples/ directory
- Add .npmignore to exclude examples from npm package
- Create comprehensive examples/README.md with usage instructions
- Organize configs (YAML, JSON, JS) in examples/config/
- Keep GraphQL operation examples in examples/graphql/

This ensures examples are available in the repository but not distributed
in the npm package, reducing package size and keeping production clean.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Environment variables now always take precedence over GraphQL Config files:
- Precedence order: Env vars > GraphQL Config > Defaults
- Allows temporary overrides without modifying config files
- Useful for debugging, testing, and CI/CD pipelines
- Follows 12-factor app principles

This is cleaner than having two sets of environment variables and matches
developer expectations that env vars override file-based configuration.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants